# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=click
pkgver=0.5.1
pkgrel=0
pkgdesc="Simplified packaging format"
url="https://gitlab.com/ubports/development/core/click"
arch="all"
license="GPL-3.0-only"
depends_dev="
	dbus-test-runner-dev
	gobject-introspection-dev
	gtest-dev
	libgee-dev
	process-cpp-dev
	properties-cpp-dev
	"
makedepends="
	$depends_dev
	autoconf
	automake
	cmake
	dbus-test-runner
	gobject-introspection
	intltool
	json-glib-dev
	libtool
	py3-setuptools
	vala
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-pyc"
source="https://gitlab.com/ubports/development/core/click/-/archive/$pkgver/click-$pkgver.tar.gz"
options="!check" # Needs dpkg

build() {
	./autogen.sh
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-packagekit \
		--disable-systemd
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir/" PYTHON_INSTALL_FLAGS="--root=$pkgdir/" install

	# Make abuild's version check happy (#386)
	sed -i s/+ubports//g "$pkgdir"/usr/lib/pkgconfig/*.pc
}

sha512sums="
4b7ba6cb0042ae126d5273ffb5f67186d5af780bbc75c6bb8c3493ecd51701921d5291bf95e0b7399a49a597a26f36dddd2075148cd9212faa55bed993405226  click-0.5.1.tar.gz
"
